package com.android.support.lib.universal.slidingmenu;

import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.view.View;

/**
 * 
 * 滑动菜单。新建类继承BaseSideFragment，添加布局和事件
 * 
 * 其子类必须有空的构造方法。切记！
 * 
 * @author 彭治铭
 *
 */
public abstract class BaseSideFragment extends Fragment {

	// @Override
	// public View onCreateView(LayoutInflater inflater, ViewGroup container,
	// Bundle savedInstanceState) {
	// View view = inflater.inflate(R.layout.布局文件ID, container,
	// false);
	// initUI(view);
	// listenner(view);
	// return view;
	// }

	Context context;

	@SuppressLint("ValidFragment")
	public BaseSideFragment(Context context) {
		super();
		this.context = context;
	}

	public BaseSideFragment() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * 初始化UI
	 * 
	 * @param view
	 *            LayoutInflater mInflater= LayoutInflater.from(getActivity());
	 *            View view = inflater.inflate(R.layout.布局文件ID, container,
	 *            false);
	 */
	protected abstract void initUI(View view);

	/**
	 * 初始监听事件
	 * 
	 * @param view
	 *            LayoutInflater mInflater= LayoutInflater.from(getActivity());
	 *            view View view = inflater.inflate(R.layout.布局文件ID, container,
	 *            false);
	 */
	protected abstract void listenner(View view);
}
